package io.tij;

import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.SortedMap;

public class AvailableCharSets {
	public static void main(String[] args){
		SortedMap<String, Charset> charSets = Charset.availableCharsets();
		Iterator<String> iterator = charSets.keySet().iterator();
		
		while(iterator.hasNext()){
			String csName = iterator.next();
			System.out.print(csName);
			Charset cs = charSets.get(csName);
			Iterator<String> aliases = cs.aliases().iterator();
			System.out.print(":");
			while(aliases.hasNext()){
				System.out.print(" " + aliases.next());
			}
			System.out.println();
		}
	}
}
